﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HidesaburoDotNET.Core.Detecctors
{
    public class ChinitsuDetector :YakuDetector
    {
        public override Yaku CheckYaku(AgariTehai agariTehai)
        {
           
            int h = 0;
            HaiType a0 = agariTehai.Hai[0].Type;
            for(;h < agariTehai.Hai.Count;h++)
            {
                HaiType a = agariTehai.Hai[h].Type;

                if (a != a0)
                {
                    return new Yaku();
                }            
            }


            if (agariTehai.Menzen)
            {
                return new Yaku(6, "チンイツ");
            }
            else
            {
                return new Yaku(5, "チンイツ");
            }

        }
    }
}
